<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layuiAdmin 管理员 iframe 框</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${pageContext.request.contextPath }/back/layui/css/layui.css" media="all">
</head>
<body>

<div class="layui-form" lay-filter="layuiadmin-form-admin" id="layuiadmin-form-admin" style="padding: 20px 30px 0 0;">
    <div class="layui-form-item">
        <label class="layui-form-label">酒店名</label>
        <div class="layui-input-inline">
            <input type="text" name="hotel_name" id="hotel_name" lay-verify="required" placeholder="请输入酒店名" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">酒店所在地区</label>
        <div class="layui-input-inline">
            <input type="text" name="hotel_city" id="hotel_city" lay-verify="required" placeholder="请输入酒店所在地区" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">酒店位置</label>
        <div class="layui-input-inline">
            <input type="text" name="hotel_address" id="hotel_address" placeholder="请输入酒店位置" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">联系电话</label>
        <div class="layui-input-inline">
            <input type="text" name="hotel_tel" id="hotel_tel" lay-verify="phone" placeholder="请输入联系电话" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item layui-hide">
        <input type="button" lay-submit lay-filter="LAY-user-front-submit" id="LAY-user-back-submit" value="确认">
    </div>
</div>

<script src="${pageContext.request.contextPath }/back/layui/layui.js"></script>
<script>
    layui.config({
        base: '${pageContext.request.contextPath }/back/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form'], function(){
        var $ = layui.$
            ,form = layui.form ;
    })
</script>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script type="text/javascript">
    $(function() {
//添加房间
        $("#LAY-user-back-submit").click(function () {
            var  hotel_name=$("#hotel_name").val();
            var  hotel_city= $("#hotel_city").val();
            var  hotel_address=$("#hotel_address").val();
            var  hotel_tel=$("#hotel_tel").val();
            $.ajax({
                type : "POST",
                url : "${pageContext.request.contextPath }/HotelController/getAddHotel",
                data : {
                    hotel_name:hotel_name,
                    hotel_city:hotel_city,
                    hotel_address:hotel_address,
                    hotel_tel:hotel_tel,
                },
                dataType : "json",
                success : function(data) {
                    layer.msg('添加成功');
                    $(".layui-laypage-btn").click() ;
                }
            })
        })
    })

</script>
</body>
</html>